#include "Event.h"

 
/*
void Event::Event(){
//_done = FALSE;
_name = " ";
_description = " ";
_priority = NORMAL;
_location = " ";
_id = " ";
//_date = time();
}
*/

Event::Event(void){
	//_eventType = FLOATING;
}


Event::~Event(void){
	//_eventType = FLOATING;
}

void Event::setName(std::string name){
	_name = name;
}

std::string Event::getName(){
	return _name;
}

EventType Event::getEventType(){
	return _eventType;
}

//@author A0105735J
std::string Event::getEventStatus(){
	return _eventStatus;
}

void Event::setImportanceLevel( std::string priorityLevel){
	_priority = priorityLevel;
}

//@author A0105735J
void Event::setStatus( std::string status){
	_eventStatus = status;
}

std::string Event::getImportanceLevel(){
	return _priority;        
}



// print out importance level
// will be rewritten

void Event:: printImportanceLevel(){
	return;
}



void Event::setLocation(std::string location){
	_location = location;
}

std::string Event::getLocation(){
	return _location;
};

/*
void Event::setDescription( string description){
_description = description;
}
*/


/*
void Event::getDescription(){
return _description;
}
 */
void Event::setDisplayID(int s){
	_displayID = s;
/*
ostringstream ss;
ss <<_date.getYear() << _date.getMonth() << _date.getDay() << _date.getHour()<< _date.getMin();
_id = ss.str();
*/
}

int Event::getDisplayID(){
	return _displayID;
}

void Event::setSearchID(int s){
	_searchID = s;
}

int Event::getSearchID(){
	return _searchID;
}

void Event::setEventType(std::string type)
{
	if(type=="TimedEvent")
		_eventType=TIME;
	else if(type=="DeadlineEvent")
		_eventType=DEADLINE;
	else
		_eventType=FLOATING;
}

// this section

/*
DateTime Event:: getDate(){
   return _date;
}

void Event:: setDate(DateTime dateTime)
{
   _date=dateTime;
}
*/

DateTime Event :: getTimedEventEndTime(){
	return _date;
}

DateTime Event::getTimedEventDuration(){
	return _date;
}
DateTime Event::getTimedEventStartTime(){
	return _date;
}

void Event::setTimedEventStartTime(DateTime dateTime){
	_date=dateTime;
}

void Event::setTimedEventEndTime(DateTime dateTime){
	_date= dateTime;
}

void Event:: setTimedEventDuration(DateTime dateTime){
	_date=dateTime;
}

DateTime Event:: getDeadlineEventEndTime(){
	return _date;
}

void Event:: setDeadlineEventEndtime(DateTime dateTime){
	_date=dateTime;
}

//

void Event::printEvent(){
	return;
}

void Event::getEventDateTime(int& day, int& month, int& year){
	if(getEventType() == TIME){
		day = getTimedEventStartTime().getDay();
		month = getTimedEventStartTime().getMonth();
		year = getTimedEventStartTime().getYear();
	}
	if(getEventType() == DEADLINE){
		day = getDeadlineEventEndTime().getDay();
		month = getDeadlineEventEndTime().getMonth();
		year = getDeadlineEventEndTime().getYear();
	}
}

bool Event::isEventOnDateClicked (int dayClicked, int monthClicked, int yearClicked) {
	int day, month, year;
	getEventDateTime(day, month, year);
	if((dayClicked==day)&&(monthClicked==month)&&(yearClicked==year))
		return true;
    return false;
} 

std::string Event:: getIDInString(){
	std::ostringstream ss;
	ss<<_displayID;
	return ss.str();
}